package com.example05.demo.servlet;

import com.example05.demo.pojo.vo.ResultVO;
import com.example05.demo.service.CategoryService;
import com.example05.demo.service.impl.CategoryServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/category")
public class CategoryServlet extends BaseServlet{
    private final CategoryService categoryService = new CategoryServiceImpl();
    //实现category的分页功能
    public ResultVO<?> pageCategory(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String pageNum = req.getParameter("pageNum");
        String pageSize = req.getParameter("pageSize");
        return categoryService.getCategoryList(pageNum, pageSize);
    }

}
